import {request} from "./request";

export function getQuestionAnswers(question_id) {
  return request({
    method: "get",
    url: `router.php?t=question/getAnswers/${question_id}/`
  })
}

export function postQuestion(obj) {
  return request({
    method: "post",
    url: "router.php?s=question/",
    data: JSON.stringify(obj)
  })
}

export function putQuestion(question_id, obj) {
  return request({
    method: "put",
    url: `router.php?s=question/${question_id}/`,
    data: JSON.stringify(obj)
  })
}

export function getAllQuestions() {
  return request({
    method: "get",
    url: `router.php?s=question/`
  })
}

export function getQuestion(question_id) {
  return request({
    method: "get",
    url: `router.php?s=question/${question_id}/`
  })
}

export function getUserQuestion(user_id) {
  return request({
    method: "get",
    url: `router.php?t=question/getUserQuestion/${user_id}/`
  })
}
